package com.chixing.day12_date_factory.word;

import java.util.ArrayList;

public class StringDemo {
    public static void main(String[] args) {
        String str1 = "AkaAAAaAAAAEsEe1BiCeiDDsslD";
        //System.out.println(str1.charAt(0));
        ArrayList<String> arrayList = new ArrayList<>();



        for (int i=0;i<str1.length();i++){
            String s = String.valueOf(str1.charAt(i));
            arrayList.add(s);
        }



        int a = 0;
        for (int i =0;i<arrayList.size()-a;i++){
            if (arrayList.get(i).hashCode()>=65 && arrayList.get(i).hashCode()<=90){
                    String temp = arrayList.get(i);
                    arrayList.remove(arrayList.get(i));
                    arrayList.add(temp);
                    a++;
                    i--;
            }
        }
        System.out.println(arrayList);
        String str ="";
        for (String i:arrayList){
            str+=i;
        }
        System.out.println(str);



        //for(int i=0;i<arrayList.size())

        /*ArrayList<Character> arrayList1 = new ArrayList<>();
        ArrayList<Character> arrayList2 = new ArrayList<>();
        for (Character i:arrayList){
            if (i>='A'&&i<='Z')
                arrayList2.add(i);
            else
                arrayList1.add(i);
        }
        //System.out.println(arrayList1);
        //System.out.println(arrayList2);
        arrayList1.addAll(arrayList2);
        String str ="";
        for (Character i:arrayList1){
            str+=i;
        }
        System.out.println(str);*/




    }
}
